package com.ruoyi.sgsc.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sgsc.mapper.addressesMapper;
import com.ruoyi.sgsc.domain.addresses;
import com.ruoyi.sgsc.service.IaddressesService;

/**
 * 用户地址Service业务层处理
 * 
 * @author wy
 * @date 2024-09-29
 */
@Service
public class addressesServiceImpl implements IaddressesService 
{
    @Autowired
    private addressesMapper addressesMapper;

    /**
     * 查询用户地址
     * 
     * @param addressId 用户地址主键
     * @return 用户地址
     */
    @Override
    public addresses selectaddressesByAddressId(Long addressId)
    {
        return addressesMapper.selectaddressesByAddressId(addressId);
    }

    /**
     * 根据用户id获取地址id
     * @param userId
     * @return
     */
    @Override
    public  List<addresses> selectaddressesByUserId(Long userId)
    {
        return addressesMapper.selectaddressesByUserId(userId);
    }


    /**
     * 查询用户地址列表
     * 
     * @param addresses 用户地址
     * @return 用户地址
     */
    @Override
    public List<addresses> selectaddressesList(addresses addresses)
    {
        return addressesMapper.selectaddressesList(addresses);
    }


    /**
     * 新增用户地址
     * @param addresses 用户地址
     * @return 结果
     */
    @Override
    public int insertaddresses(addresses addresses)
    {
        return addressesMapper.insertaddresses(addresses);
    }

    /**
     * 修改用户地址
     * @param addresses 用户地址
     * @return 结果
     */
    @Override
    public int updateaddresses(addresses addresses)
    {
        return addressesMapper.updateaddresses(addresses);
    }

    /**
     * 批量删除用户地址
     * 
     * @param addressIds 需要删除的用户地址主键
     * @return 结果
     */
    @Override
    public int deleteaddressesByAddressIds(Long[] addressIds)
    {
        return addressesMapper.deleteaddressesByAddressIds(addressIds);
    }

    /**
     * 删除用户地址信息
     * 
     * @param addressId 用户地址主键
     * @return 结果
     */
    @Override
    public int deleteaddressesByAddressId(Long addressId)
    {
        return addressesMapper.deleteaddressesByAddressId(addressId);
    }
}
